package cn.xjzn.framework_Core;

/**
 * 枚举，模块，为子系统的下级分类
 */
public enum ModuleServe  {
    UNKNOWN("未知","-1",Subsystems.Sys,null,null),
    personModule("用户模块","10001",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.User", new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.EXPORT}),
    sysConfigModule("系统配置模块","10003",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.SysConfig",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE}),
    sysLocationModule("位置模块","10004",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.SysLocation",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE}),
    sysUserConfigModule("用户配置模块","10005",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.SysUserConfig",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE}),
    organizationModule("组织机构模块","10006",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.Organization",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE}),
    dictGroupModule("字典分组","10007",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.DictGroup",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE}),

    roleModule("角色模块","10002",Subsystems.Master,"cn.jeeweb.web.modules.sys.entity.Role",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    shiftsModule("班次","10010",Subsystems.Master,"cn.jeeweb.web.modules.master.entity.MasterShifts",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    calendarModule("日历","10011",Subsystems.Master,"cn.jeeweb.web.modules.master.entity.MasterCalendar",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    pipeStandardModule("产品标准数据","10012",Subsystems.Master,"cn.jeeweb.web.modules.master.entity.MasterPipeStandard",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),

    equipmentCatalogModule("设备类别","50010",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsEquipmentCatalog",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    equipmentModule("设备资产信息","50011",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsEquipment",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsMaintenancePlanModule("设备保养计划", "50012",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsMaintenancePlan",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsMaintenanceTaskModule("设备保养任务", "50014",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsMaintenanceTask",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsMaintenanceCheckModule("设备点检", "50017",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsMaintenanceCheck",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsMaintenanceCheckTemplateModule("设备点检模板", "50019",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsMaintenanceCheckTemplate",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsMaintenanceCheckHistoryModule("设备点检记录", "50018",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsMaintenanceCheckHistory",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsFaultCodeModule("设备原因码", "50020",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsFaultCode",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsRepairRequistionModule("设备报修", "50015",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsRepairRequistion",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsRepairModule("设备维修", "50016",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsRepair",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsPartsModule("设备备件", "50013",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsParts",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsFixtureModule("设备工装", "50022",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsFixture",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsCheckModule("设备零件检验", "50027",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsCheck",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.EXPORT}),
    eqsSparePartModule("设备备件", "50024",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsSparePart",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsSparePartRefModule("设备备件引用", "50024ref",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsSparePart",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.DELETE,ModuleActionType.SELECT,ModuleActionType.CUSTOM1,ModuleActionType.CUSTOM2,ModuleActionType.CUSTOM3,ModuleActionType.EXPORT}),
    eqsFixtureRefModule("设备工装引用", "50022ref",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsFixture",new ModuleActionType[]{}),
    eqsOperateApplyModule("设备工装操作申请", "50023",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsOperateApply",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE}),
    eqsSpareOperateApplyModule("设备备件操作申请", "50025",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsSpareOperateApply",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE}),
    eqsOverTimeModule("加班", "50026",Subsystems.Equipment,"cn.jeeweb.web.modules.equipment.entity.EqsOverTime",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE}),
    sysGroupModule("分组管理", "50021",Subsystems.Sys,"cn.jeeweb.web.modules.sys.entity.SysGroup",new ModuleActionType[]{ModuleActionType.INSERT,ModuleActionType.UPDATE,ModuleActionType.DELETE,ModuleActionType.SELECT});


    /**
     * 根据value得到枚举项
     * 普通for循环遍历，比较判断
     *
     * @param value
     * @return
     */
    public static ModuleServe getEnumByValue(String value) {
        ModuleServe[] ModuleServes = ModuleServe.values();
        for (int i = 0; i < ModuleServes.length; i++) {
            if (ModuleServes[i].getValue().equals(value)) {
                return ModuleServes[i];
            }
        }
        return ModuleServe.UNKNOWN;
    }

    /**
     * 模块名称
     */
    private String name;

    /**
     * 模块ID
     */
    private String value;
    /**
     * 允许的操作
     */
    private ModuleActionType[] actions;
    /**
     * 所属子系统
     */
    private Subsystems subsystem;

    public String getEntityName() {
        return entityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    /**
     * 主实体名
     */
    private String entityName;


    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }

    public ModuleActionType[] getActions() {
        return actions;
    }
    public void setActions(ModuleActionType[] value){this.actions=value;}

    public Subsystems getSubsystem() {
        return subsystem;
    }

    public void setSubsystem(Subsystems subsystem) {
        this.subsystem = subsystem;
    }

    ModuleServe(String name, String value,Subsystems subsystem,String entityName, ModuleActionType[] actions) {
        this.name = name;
        this.value = value;
        this.actions=actions;
        this.subsystem=subsystem;
        this.entityName=entityName;
    }
}
